Learn R Programming

bfp (version 0.0-48)

BayesMfp Methods: Other methods for BayesMfp objects

Description

Print the object (print), get fitted values (fitted) and corresponding residuals (residuals).

Usage

# S3 method for BayesMfp
print(x, ...)
# S3 method for BayesMfp
fitted(object, design = getDesignMatrix(object), post =
getPosteriorParms(object, design = design), ...) 
# S3 method for BayesMfp
residuals(object, ...)

Arguments

x

valid BayesMfp object

object

valid BayesMfp object, only the first model will be used.

design

design matrix of the first model in the object, which can be supplied by the caller if it is computed beforehand

post

posterior parameters of the normal-gamma distribution (defaults to the posterior expected mean, marginalized over the covariance factor g)

...

unused

Author

Daniel Saban\'es Bov\'e

See Also

BayesMfp, BmaSamples Methods

Examples

Run this code
## generate a BayesMfp object
set.seed(19)

x1 <- rnorm(n=15)
x2 <- rbinom(n=15, size=20, prob=0.5) 
x3 <- rexp(n=15)

y <- rt(n=15, df=2)

test <- BayesMfp(y ~ bfp (x2, max = 4) + uc (x1 + x3), nModels = 100,
                 method="exhaustive")

## the print method
test

## extract fitted values and corresponding residuals
fitted(test)
residuals(test)

Run the code above in your browser using DataLab